/* 基础样式 */
:root {
  --primary: #1677ff;
  --primary-light: #4096ff;
  --primary-dark: #0958d9;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f0f2f5;
  color: rgba(0, 0, 0, 0.85);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* 布局 */
.app-container {
  min-height: 100vh;
}

.site-layout-content {
  padding: 12px;
  min-height: calc(100vh - 48px - 40px);
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
}

/* 侧边栏 */
.ant-layout-sider {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.logo {
  height: 48px;
  display: flex;
  align-items: center;
  padding-left: 16px;
  color: white;
  font-size: 16px;
  font-weight: 600;
}

/* 头部 */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  height: 48px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 页面标题 */
.page-header {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 面包屑 */
.breadcrumb {
  margin-bottom: 12px;
}

/* 过滤器 */
.filter-card {
  margin-bottom: 12px;
}

.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* 内容容器 */
.content-container {
  margin-bottom: 12px;
}

/* 分页容器 */
.pagination-container {
  margin-top: 12px;
  text-align: right;
}

/* 加载容器 */
.loading-container {
  text-align: center;
  padding: 40px 0;
}

/* 项目卡片 */
.project-card {
  height: 100%;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.project-card:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.project-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tags {
  display: flex;
  gap: 4px;
}

.project-department {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 6px;
}

.project-description {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  height: 32px;
  margin-bottom: 6px;
}

.project-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.stat-item {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #f0f0f0;
  padding-top: 6px;
}

/* 项目详情页 */
.project-header-card {
  margin-bottom: 12px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-info {
  flex: 1;
}

.project-meta {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}

.project-actions {
  display: flex;
  gap: 8px;
}

.project-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 6px;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  font-size: 20px;
  color: #1677ff;
  opacity: 0.7;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
}

/* Hosts 表格 */
.hosts-card {
  margin-bottom: 12px;
}

.hosts-table .ant-table-cell {
  padding: 6px 12px;
}

.hosts-name {
  font-weight: 500;
}

.hosts-content-preview {
  font-family: monospace;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow: hidden;
}

.comment-line {
  color: rgba(0, 0, 0, 0.45);
}

.more-indicator {
  color: rgba(0, 0, 0, 0.45);
}

.hosts-description {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
}

/* Hosts 块卡片 */
.hosts-block-card {
  height: 100%;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hosts-block-card:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.hosts-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.hosts-block-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hosts-block-description {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
  margin-bottom: 6px;
}

.hosts-block-content {
  font-family: monospace;
  font-size: 12px;
  line-height: 1.4;
  background-color: #f5f5f5;
  padding: 6px;
  border-radius: 4px;
  margin-bottom: 6px;
  max-height: 80px;
  overflow: hidden;
}

.hosts-block-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #f0f0f0;
  padding-top: 6px;
}

/* 部门视图 */
.department-header-card {
  margin-bottom: 12px;
}

.department-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.department-info {
  flex: 1;
}

.department-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.department-icon {
  font-size: 18px;
  color: #1677ff;
}

.department-title {
  margin: 0;
}

.department-code {
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}

.department-description {
  font-size: 12px;
  display: block;
}

.department-stats {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.projects-card {
  margin-bottom: 12px;
}

.card-title-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.projects-table .ant-table-cell {
  padding: 6px 12px;
}

.view-tabs {
  margin-bottom: 0;
}

.view-mode-selector {
  margin-left: auto;
}

.table-actions {
  display: flex;
  gap: 8px;
}

/* 标签样式 */
.env-tag {
  font-size: 12px;
  padding: 0 6px;
  border-radius: 2px;
  line-height: 18px;
  height: 18px;
}

.env-tag.env-dev {
  color: #1677ff;
  background: #e6f4ff;
  border: 1px solid #91caff;
}

.env-tag.env-prod {
  color: #ff4d4f;
  background: #fff1f0;
  border: 1px solid #ffa39e;
}

.dept-tag {
  font-size: 12px;
  padding: 0 6px;
  border-radius: 2px;
  line-height: 18px;
  height: 18px;
  color: #52c41a;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
}

/* 响应式 */
@media (max-width: 768px) {
  .project-header {
    flex-direction: column;
    gap: 12px;
  }

  .project-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .filter-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-container > * {
    width: 100% !important;
  }

  .view-mode-selector {
    width: 100%;
    margin-top: 8px;
  }
}
